'use strict';

const Controller = require('egg').Controller;

class DetailController extends Controller {
  async index() {
    const {ctx} = this
    const {id} = ctx.query
    const res = await ctx.service.movie.getMovieDetailOrSearch({id})
    if(res.length){
        ctx.body={
            status:200,
            res
        }
    }else{
        ctx.status = 400,
        ctx.body = {
            status:400,
            msg:"输入的id不合法"
        }
    }
  }
}

module.exports = DetailController;
